﻿@model BillBox.Models.Bill

@{
    ViewBag.Title = "View Receipt";
    Layout = "~/Views/Shared/_Default.cshtml";
}

<div id="receipt-view">
    <div class="receipt-header">
        <div class="logo">
            <img src="@Url.Content("~/Assets/img/logo.png")" alt="Logo" />
        </div>
        <div class="address">
            <p>
                @Model.User.AgentBranch.AddressStreet
                <br />
                @Model.User.AgentBranch.AddressCity
                <br />
                @Model.User.AgentBranch.Parish.Name
            </p>
        </div>
    </div>
    <div class="receipt-body">
        <div class="bill-fields">
            <table>
                <tr>
                    <td class="field">@Html.DisplayNameFor(m => m.BillId)</td>
                    <td class="value">@Html.DisplayFor(m => m.BillId)</td>

                </tr>
                <tr>
                    <td class="field">@Html.DisplayNameFor(m => m.SubscriberId)</td>
                    <td class="value">@Html.DisplayFor(m => m.Subscriber.Name)</td>
                </tr>
                <tr>
                    <td class="field">@Html.DisplayNameFor(m => m.Date)</td>
                    <td class="value">@Html.DisplayFor(m => m.Date)</td>
                </tr>
            </table>
        </div>
        <div class="bill-payments">
            <table>
                <thead>
                    <tr>
                        <th>Payment(s)</th>
                        <th>Amount</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (BillBox.Models.Payment payment in Model.Payments)
                    {
                        <tr>
                            <td class="field">@payment.PaymentMethod.Name</td>

                            <td class="value">@BillBox.Common.Util.DisplayForDollar(payment.Amount)</td>
                        </tr>
                    }
                    <tr>
                        <td class="field">Subtotal</td>
                        <td class="value">@BillBox.Common.Util.DisplayForDollar(Model.Amount())</td>
                    </tr>
                    <tr>
                        <td class="field">Processing Fee</td>
                        <td class="value">@BillBox.Common.Util.DisplayForDollar(Model.ProcessingFee.GetValueOrDefault() + Model.ProcessingFeeGCT.GetValueOrDefault())</td>
                    </tr>
                    <tr>
                        <td class="field"><strong>Total</strong></td>
                        <td class="value">@BillBox.Common.Util.DisplayForDollar(Model.Total())</td>
                    </tr>
                </tbody>
            </table>

        </div>
    </div>

    <div class="receipt-footer">
    </div>
</div>
